home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip: 2005 Utilities
/
CHIP Utilities 2005.7z
/
CHIP Utilities 2005.iso
/
images
/
arachne.igz
/
arachne.img
/
LEVEL0
/
UTILZ.CAB
/
bin
/
DRD.BAT
< prev
next >
Wrap
DOS Batch File
|
2005-01-16
|
3KB
|
119 lines
@if "%debug%"=="" echo off
if "%1"==":" if not "%2"=="" goto %2
for %%f in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do if "%1"=="%%f:" goto _begin
for %%f in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if "%1"=="%%f:" goto _begin
if not "%1"=="" if not "%1"=="*" goto _end
for %%f in (A C D E F G H I J K L M N O P Q R S T U V W X Y Z) do call %0 : _test %%f: %1
goto _end
:_test
shift
shift
:_begin
goto _dready
if not "%os%"=="fd" goto _dready
if "%fdk%"=="" call fdk.bat
varset _drd=30-%fdk% >%tmp%\nul
set _drd=
if errorlevel 1 goto _dready
el! 0
if not exist %1\nul el! 255
if errorlevel 255 goto _255
dir %1 | tfind "volume" "in" "drive" "is" >%tmp%\nul
if errorlevel 1 el! 2
if errorlevel 2 goto _2
echo DRD: (FreeDos workaround) Please ignore any warnings and/or press 'A' or 'F'
echo please delete this file >%1\_!@0@!_.$0$
if exist %1\_!@0@!_.$0$ goto _writable
goto _1
:_writable
if exist %1\_!@0@!_.$0$ del %1\_!@0@!_.$0$ >%tmp%\nul
goto _memdsk
:_dready
dready %1
set _drd=%errrorlevel%
if "%_drd%"=="" goto _n1level
if not "%2"=="/!" if not "%2"=="-!" if not "%3"=="/!" if not "%3"=="-!" goto _n1level
echo DRD: '%1' %_drd% (dready)
:_n1level
if errorlevel 255 goto _255
if errorlevel 2 goto _2
if "%2"=="/@" goto _01
if "%2"=="-@" goto _01
if "%3"=="/@" goto _01
if "%3"=="-@" goto _01
dready %1 /W
set _drd=%errrorlevel%
if "%_drd%"=="" goto _n2level
if not "%2"=="/!" if not "%2"=="-!" goto _n2level
echo DRD: '%1' %_drd% (dready /w)
:_n2level
if errorlevel 2 goto _1
if errorlevel 1 goto _1
goto _memdsk
:_memdsk
if not exist %ramdrv%\bin\ifmemdsk.com goto _0
for %%f in (a b c A B C) do if "%1"=="%%f:" goto _mmdsk
goto _0
:_mmdsk
%ramdrv%\bin\ifmemdsk.com >%tmp%\nul
if errorlevel 3 if "%1"=="C:" goto _00
if errorlevel 3 if "%1"=="c:" goto _00
if errorlevel 3 goto _0
if errorlevel 2 if "%1"=="B:" goto _00
if errorlevel 2 if "%1"=="b:" goto _00
if errorlevel 2 goto _0
if errorlevel 1 if "%1"=="A:" goto _00
if errorlevel 1 if "%1"=="a:" goto _00
goto _0
:_0
el! 0
if "%2"=="/$" goto _end
if "%2"=="-$" goto _end
if "%3"=="/$" goto _end
if "%3"=="-$" goto _end
echo DRD: '%1' writable
goto _end
:_00
el! 0
if "%2"=="/$" goto _end
if "%2"=="-$" goto _end
if "%3"=="/$" goto _end
if "%3"=="-$" goto _end
echo DRD: '%1' writable (memdisk fake writable)
goto _end
:_01
if "%2"=="/$" goto _end
if "%2"=="-$" goto _end
if "%3"=="/$" goto _end
if "%3"=="-$" goto _end
echo DRD: '%1' accessible
goto _end
:_1
el! 1
if "%2"=="/$" goto _end
if "%2"=="-$" goto _end
if "%3"=="/$" goto _end
if "%3"=="-$" goto _end
echo DRD: '%1' readonly
goto _end
:_2
if "%2"=="/$" goto _end
if "%2"=="-$" goto _end
if "%3"=="/$" goto _end
if "%3"=="-$" goto _end
echo DRD: '%1' inaccessible
goto _end
:_255
if "%2"=="*" goto _end
if "%2"=="/$" goto _end
if "%2"=="-$" goto _end
if "%3"=="/$" goto _end
if "%3"=="-$" goto _end
echo DRD: '%1' invalid
goto _end
:_end
set _drd=